/* vue */
import { defineComponent } from "vue";
/* mixin */
import VersionControlBaseMixin from '@src/mixins/versionControlMixin/base';
/* version form */
import {
  isShowFormEmailField,
  isShowFormConnectorField,
  isShowFormRelatedTaskField,
  isShowFormRelationFormField,
  isShowFormServiceProviderField
} from '@shb-lib/version'

export default defineComponent({
  name: "version-control-form-mixin",
  mixins: [VersionControlBaseMixin],
  computed: {
    /** 
     * @description 表单模块 版本控制
    */
    formVersionControl(): Record<string, boolean> {
      return {
        isShowFormEmailField: isShowFormEmailField(this._versionControlMap),
        isShowFormConnectorField: isShowFormConnectorField(this._versionControlMap),
        isShowFormRelatedTaskField: isShowFormRelatedTaskField(this._versionControlMap),
        isShowFormRelationFormField: isShowFormRelationFormField(this._versionControlMap),
        isShowFormServiceProviderField: isShowFormServiceProviderField(this._versionControlMap)
      }
    },
    _isShowFormEmailField(): boolean {
      return this.formVersionControl.isShowFormEmailField
    },
    _isShowFormConnectorField(): boolean {
      return this.formVersionControl.isShowFormConnectorField
    },
    _isShowFormRelatedTaskField(): boolean {
      return this.formVersionControl.isShowFormRelatedTaskField
    },
    _isShowFormRelationFormField(): boolean {
      return this.formVersionControl.isShowFormRelationFormField
    },
    _isShowFormServiceProviderField(): boolean {
      return this.formVersionControl.isShowFormServiceProviderField
    },
  }
})
